package solution;

import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ws
 * Date: 2023-01-17
 * Time: 22:06
 */
public class Solution6 {
    public static void main(String[] args) {
        int[][] arr = new int[3][3];
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                arr[i][j] = (int) (Math.random() * 10);
                if (i == j || i + j == 2) {
                    sum += arr[i][j];
                }
            }
        }
        System.out.println(Arrays.deepToString(arr));
        System.out.println(sum);
    }
}
